﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true" CodeFile="NhanVien.aspx.cs" Inherits="Admin_Default" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7" style="width: 643px" width="1000px">
        <tr>
            <td>
                <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="View3" runat="server">
                        <table class="style7">
                            <tr>
                                <td class="style8" valign="top" style="height: 26px">
                                    Tên nhân viên:</td>
                                <td align="left" style="width: 344px; height: 26px;">
                                    <asp:TextBox ID="TextBox16" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" valign="top">
                                    Giới tính:</td>
                                <td align="left" style="width: 344px">
                                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" Width="153px">
                                        <asp:ListItem Value="Nam">Nam</asp:ListItem>
                                        <asp:ListItem Value="Nữ">Nữ</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td class="style8">
                                    &nbsp;</td>
                                <td align="left" style="width: 344px">
                                    <asp:Button ID="Button11" runat="server" Text="Tìm" onclick="Button11_Click" 
                                        style="height: 26px" CausesValidation="False" />
                                    <br />
                                    <asp:Label ID="Label1" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" colspan="2">
                                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                                        onpageindexchanging="GridView1_PageIndexChanging" 
                                        onrowcancelingedit="GridView1_RowCancelingEdit" 
                                        onrowediting="GridView1_RowEditing" 
                                        onrowupdating="GridView1_RowUpdating" AllowPaging="True">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="CheckBox1" runat="server" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="MaNV" HeaderText="Mã nhân viên" ReadOnly="True" />
                                            <asp:BoundField DataField="HoTen" HeaderText="Họ tên" />
                                            <asp:BoundField DataField="TenDN" HeaderText="Tên Đăng nhập" />
                                            <asp:BoundField DataField="MatKhau" HeaderText="Mật khẩu" />
                                            <asp:TemplateField HeaderText="Giới tính">
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("GioiTinh") %>'></asp:Label>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <asp:RadioButtonList ID="RadioButtonList3" runat="server">
                                                        <asp:ListItem Value="True">Nam</asp:ListItem>
                                                        <asp:ListItem Value="False">Nữ</asp:ListItem>
                                                    </asp:RadioButtonList>
                                                </EditItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="NgaySinh" HeaderText="Ngày sinh" 
                                                DataFormatString="{0:dd/MM/yyyy}" />
                                            <asp:BoundField DataField="DiaChi" HeaderText="Địa chỉ" />
                                            <asp:BoundField DataField="Email" HeaderText="Email" />
                                            <asp:BoundField DataField="DienThoai" HeaderText="Điện thoại" />
                                            <asp:BoundField DataField="CMND" HeaderText="CMND" />
                                            <asp:CommandField EditText="Sửa" ShowEditButton="True" CancelText="Hủy" 
                                                UpdateText="Lưu" />
                                        </Columns>
                                    </asp:GridView>
                                    <asp:Button ID="Button15" runat="server" Text="Xóa" onclick="Button15_Click" 
                                        CausesValidation="False" />
                                    <asp:Button ID="Button12" runat="server" onclick="Button12_Click" Text="Thêm" 
                                        CausesValidation="False" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                    <asp:View ID="View1" runat="server">
                        <table class="style7" style="width: 537px">
                            <tr>
                                <td colspan="2" style="font-size: 25px; color: #800000; font-weight: bold;">
                                    Thêm nhân viên<asp:ValidationSummary ID="ValidationSummary1" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2" style="font-size: 25px; color: #800000; font-weight: bold;">
                                    <asp:Label ID="Label2" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Họ tên:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="TextBox6" ErrorMessage="Họ tên không được rỗng">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Tên đăng nhâp:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox19" runat="server" Width="162px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                        ControlToValidate="TextBox12" 
                                        ErrorMessage="Tên đăng nhập không được rỗng">*</asp:RequiredFieldValidator>
                                    <asp:CustomValidator ID="CustomValidator1" runat="server" 
                                        ControlToValidate="TextBox19" ErrorMessage="Tên đăng nhập đã tồn tại" 
                                        onservervalidate="CustomValidator1_ServerValidate">*</asp:CustomValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Mật khẩu:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox20" runat="server" Width="161px" TextMode="Password"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                        ControlToValidate="TextBox12" ErrorMessage="Mật khẩu không được rỗng">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Nhập lại mật khẩu:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox21" runat="server" TextMode="Password" Height="22px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                                        ControlToValidate="TextBox21" 
                                        ErrorMessage="Mật khẩu nhập lại không được rỗng">*</asp:RequiredFieldValidator>
                                    <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                        ControlToCompare="TextBox21" ControlToValidate="TextBox20" 
                                        ErrorMessage="Mật khảu không trùng">*</asp:CompareValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Giới tính:</td>
                                <td align="left">
                                    <asp:RadioButtonList ID="RadioButtonList2" runat="server">
                                        <asp:ListItem Value="True">Nam</asp:ListItem>
                                        <asp:ListItem Value="False">Nữ</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Ngày sinh:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" 
                                        ControlToValidate="TextBox9" ErrorMessage="Ngày sinh không được rỗng">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Địa chỉ:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox10" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                        ControlToValidate="TextBox10" ErrorMessage="Đại chỉ không được rỗng">*</asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Điện thoại:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox11" runat="server" Width="132px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" 
                                        ControlToValidate="TextBox11" 
                                        ErrorMessage="Vui lòng nhập vào số điện thoại">*</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                                        ControlToValidate="TextBox11" ErrorMessage="Không phải số điện thoại" 
                                        ValidationExpression="\d{1,15}">*</asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    Email:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox12" runat="server" Width="292px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                        ControlToValidate="TextBox12" ErrorMessage="E mail  không được rỗng">*</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                                        ControlToValidate="TextBox12" ErrorMessage="E mail không đúng cấu trúc" 
                                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 135px">
                                    CMND:</td>
                                <td align="left">
                                    <asp:TextBox ID="TextBox17" runat="server"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator13" runat="server" 
                                        ControlToValidate="TextBox17" ErrorMessage="Vui lòng nhập số CMND">*</asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                                        ControlToValidate="TextBox17" ErrorMessage="CMND không được nhập chữ, và không quá 9 số" 
                                        ValidationExpression="\d{1,9}">*</asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                                <td align="left">
                                    <asp:Button ID="Button14" runat="server" onclick="Button14_Click1" Text="Lưu" />
                                </td>
                            </tr>
                        </table>
                    </asp:View>
                </asp:MultiView>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>

